﻿@using SCMS.Resources
@model IEnumerable<SCMS.UI.Models.AdvanceRequestModel>

@if (Model.Count() > 0)
{
    <div id="tablewrapper">
        <div id="tableheader">
            <div class="search">
                <b>@Resources_frank.Global_String_SearchBy:</b><br />
                <select id="columns2" onchange="sorter2.search('query2')"></select>
                <input type="text" id="query2" onkeyup="sorter2.search('query2')" />
            </div>
            <span class="details">
                <div>@Resources_frank.Global_String_Records <span id="startrecord2"></span>-<span id="endrecord2"></span> @Resources_frank.Global_String_Of <span id="totalrecords2"></span></div>
            </span>
        </div>
        <br /><br /><br />
        <table width="98%" align="center" cellpadding="0" cellspacing="0" border="0" id="table2" class="tinytable">
            <thead>
                <tr>
                    <th><h3>@Resources_frank.Global_String_RFANo</h3></th><th><h3>@Resources_frank.Global_String_Requester</h3></th><th><h3>@Resources_frank.Global_String_PaymentType</h3></th>
                    <th><h3>@Resources_frank.Global_String_Currency</h3></th><th><h3>@Resources_frank.Global_String_TotalAmount</h3></th><th><h3>@Resources_frank.Global_String_AuthDate</h3></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr   onclick="sendRequest('/Request4Advance/ViewRADetails?id=@item.Id&checkPost=true', 'FundPostingDiv', 'loading')" style=" cursor:pointer;">
                        <td align="left">
                            @item.RefNumber
                        </td>
                        <td align="left">
                            @item.Payee
                        </td>
                        <td align="center">
                            @item.PaymentType
                        </td>
                        <td align="center">
                            @item.Currency
                        </td>
                        <td align="right">
                            @item.TotalAdvance.ToString("#,##0.00")
                        </td>
                        <td align="center">@item.AuthorizedOn.ToString("dd/MM/yyyy")
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div id="tablefooter">
            <div id="tablenav2">
                <div>
                    <img src="../../Content/images/pager/first.gif" width="16" height="16" alt="@Resources_frank.Global_String_FirstPage" onclick="sorter2.move(-1,true)" />
                    <img src="../../Content/images/pager/previous.gif" width="16" height="16" alt="@Resources_frank.Global_String_PreviousPage" onclick="sorter2.move(-1)" />
                    <img src="../../Content/images/pager/next.gif" width="16" height="16" alt="@Resources_frank.Global_String_NextPage" onclick="sorter2.move(1)" />
                    <img src="../../Content/images/pager/last.gif" width="16" height="16" alt="@Resources_frank.Global_String_LastPage" onclick="sorter2.move(1,true)" />
                </div>
                <div>
                    <select id="pagedropdown"></select>
                </div>
                <div>
                    <a href="javascript:sorter2.showall()">@Resources_frank.Global_String_ViewAll</a>
                </div>
            </div>
            <div id="tablelocation">
                <div>
                    <select onchange="sorter2.size(this.value)">
                    <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="20" selected="selected">20</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                    <span>@Resources_frank.Global_String_EntriesPerPage</span>
                </div>
                <div class="page">@Resources_frank.Global_String_Page <span id="currentpage2"></span> @Resources_frank.Global_String_Of <span id="totalpages2"></span></div>
            </div>
        </div>
    </div>
}
else
{
    <i>@Resources_frank.FundPosting_RFAList_NoRFAsToPost</i>
}